package com.cw.carwashvehicles.service.impl;

import com.cw.carwashvehicles.domain.CustomerVehicles;
import com.cw.carwashvehicles.mapper.CustomerVehiclesMapper;
import com.cw.carwashvehicles.service.CustomerVehiclesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CustomerVehiclesServiceImpl implements CustomerVehiclesService {

    @Autowired
    private CustomerVehiclesMapper customerVehiclesMapper;

    @Override
    public List<CustomerVehicles> selectCustomerVehiclesList(CustomerVehicles customerVehicles) {
        return customerVehiclesMapper.selectCustomerVehiclesList(customerVehicles);
    }

    @Override
    public int selectCustomerVehiclesCount(CustomerVehicles customerVehicles) {
        return customerVehiclesMapper.selectCustomerVehiclesCount(customerVehicles);
    }

    @Override
    public CustomerVehicles selectCustomerVehiclesById(Long id) {
        return customerVehiclesMapper.selectCustomerVehiclesById(id);
    }

    @Override
    public int insertCustomerVehicles(CustomerVehicles customerVehicles) {
        customerVehicles.setCreatedAt(new Date());
        return customerVehiclesMapper.insertCustomerVehicles(customerVehicles);
    }

    @Override
    public int updateCustomerVehicles(CustomerVehicles customerVehicles) {
        customerVehicles.setUpdatedAt(new Date());
        return customerVehiclesMapper.updateCustomerVehicles(customerVehicles);
    }

    @Override
    public int deleteCustomerVehiclesById(Long id) {
        return customerVehiclesMapper.deleteCustomerVehiclesById(id);
    }

    @Override
    public int deleteCustomerVehiclesByIds(Long[] ids) {
        return customerVehiclesMapper.deleteCustomerVehiclesByIds(ids);
    }
}
